/* GUI CONVERTED from rcmrw.p (converter v1.75) Tue Apr 10 12:04:49 2001 */
/* rcmrw.p - Customer Schedules : Update MRP in ship-from database            */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.6.1.5 $                                                         */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 7.0    LAST MODIFIED: 01/29/92    BY: WUG *F110*                 */
/* REVISION: 7.0    LAST MODIFIED: 03/23/92    BY: WUG *F312*                 */
/* REVISION: 7.3    LAST MODIFIED: 12/23/92    BY: WUG *G471*                 */
/* REVISION: 7.3    LAST MODIFIED: 08/13/93    BY: WUG *GE19*                 */
/* REVISION: 7.3    LAST MODIFIED: 04/11/95    BY: ame *F0QB*                 */
/* REVISION: 7.3    LAST MODIFIED: 08/02/95    BY: bcm *G0TB*                 */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98    BY: *K1Q4* Alfred Tan          */
/* REVISION: 9.1    LAST MODIFIED: 04/25/00    BY: *N0CF* Santosh Rao         */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00    BY: *N0KP* Mark Brown          */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.6.1.5 $    BY: Jean Miller         DATE: 03/22/01 ECO: *P008*     */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* UPDATE MRP DETAIL */
{mfdeclre.i}

define input parameter order_nbr as character.
define input parameter order_line as integer.
define input parameter schedule_change like mfc_logical.

define variable old_db as character.
define variable sdb_err as integer no-undo.

/* WE NEED TO USE THE sod_det INFORMATION SINCE THE HEADER
 * SITE REPRESENTS THE AR SITE IN CUSTOMER SCHEDULES */

for first sod_det
fields(sod_line sod_nbr sod_site)
where sod_nbr  = order_nbr and
      sod_line = order_line no-lock:
end. /* FOR FIRST SOD_DET */

for first si_mstr
fields(si_db si_site)
where si_site = sod_site no-lock:
end. /* FOR FIRST SI_MSTR */

if si_db <> global_db then do:

   old_db = global_db.

   {gprun.i ""gpalias3.p"" "(input si_db, output sdb_err)"}
/*GUI*/ if global-beam-me-up then undo, leave.


   {gprun.i ""rcmrwa.p""
      "(input order_nbr, input order_line, input schedule_change)"}
/*GUI*/ if global-beam-me-up then undo, leave.


   {gprun.i ""gpalias3.p"" "(input old_db, output sdb_err)"}
/*GUI*/ if global-beam-me-up then undo, leave.


end.

else do:
   {gprun.i ""rcmrwa.p""
      "(input order_nbr, input order_line, input schedule_change)"}
/*GUI*/ if global-beam-me-up then undo, leave.

end.
